#include <bits/stdc++.h>

using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned;

using u128 = unsigned __int128;
using i128 = __int128;
using namespace std;
class Solution
{
public:
    void hanota(vector<int> &A, vector<int> &B, vector<int> &C)
    {
        int n = A.size();
        dfs(A, B, C, n);
    }
    void dfs(vector<int> &A, vector<int> &B, vector<int> &C, int n)
    {
        if (n == 1)
        {
            C.push_back(A.back());
            A.pop_back();
            return;
        }
        dfs(A, C, B, n - 1);
        C.push_back(A.back());
        A.pop_back();
        dfs(B, A, C, n - 1);
    }
};